<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.Map" %>
<%@ page import="com.fz.entity.PDaomain" %>

  <script src="js/jquery-3.2.1.min.js"></script>
  <script src="js/jquery-ui-1.12.1/jquery-ui.min.js"></script>

  <link rel="stylesheet" href="${pageContext.request.contextPath}/webpage/js/jquery-ui-1.12.1/jquery-ui.theme.min.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/webpage/js/jquery-ui-1.12.1/themes/base/jquery-ui.min.css">
  <link rel="shortcut icon" href="${pageContext.request.contextPath}/webpage/favicon.ico" type="text/css" />
  

<div class="header_box" style="position: relative; height: 200px; box-shadow: none; z-index: 50; top: 0px;">
			<header style="padding-top: 30px;">
				<img class="heard_log" src="${pageContext.request.contextPath}/webpage/images/heard_log.png" style="display: block;">
				<nav>
					<img class="heard_log2" src="${pageContext.request.contextPath}/webpage/images/heard_log.png" style="display: none;">
					<ul class="fl" id="index_fl" style="width: 50%;">
						<li class="remove_cur index_is_cur <c:if test="${requestScope.t=='index'}">cur</c:if>" ><a href="index">首页</a></li>
						<li class="header_atw is_cur art_is_cur remove_cur <c:if test="${requestScope.t=='artwork'}">cur</c:if>"><a href="artwork">艺术品</a>
							<div class="nav_next" style="top: 200px;">
								<ul style="width: 50%;">
									<li><a href="details.jsp">精选</a></li>
									<li><a href="details.jsp">油画</a></li>
									<li><a href="details.jsp">国画</a></li>
									<li><a href="details.jsp">书法</a></li>
									<li><a href="details.jsp">水彩</a></li>
									<li><a href="details.jsp">版画</a></li>
								</ul>
							</div></li>
						<li class="arter_is_cur remove_cur  <c:if test="${requestScope.t=='artist'}">cur</c:if>"><a href="artist">艺术家</a></li>
						<li class="lease_is_cur remove_cur  <c:if test="${requestScope.t=='rent'}">cur</c:if>"><a href="rent">艺租赁</a></li>
						<li class="scr_hide special_is_cur remove_cur <c:if test="${requestScope.t=='zhuanchang'}">cur</c:if>" style="display: list-item;"><a href="zhuanchang">专场</a><span class="li_bd"></span></li>
						<li class="scr_hide information_is_cur remove_cur  <c:if test="${requestScope.t=='message'}">cur</c:if> " style="display: list-item;"><a href="message.jsp">资讯</a></li>
					</ul>
					<div class="search fr">
						<div class="shop fr" id="shopcart">
							<a href="shop.jsp"> <img src="${pageContext.request.contextPath}/webpage/images/shop.png">
								<p>购物车</p></a> <span id="shopcart-counter">
							<%--	<%
								    Object m =   session.getAttribute("userName");
								    if(m==null){
								        out.print(0);
								    }else{
								    	Map<Integer,PDaomain> mapSession = (Map)m;
								    	out.print(mapSession.size());
							     	}
								%>--%>
	
								</span>
						</div>
						<div class="user fr">

							<img src="/webpage/images/user.png">
							<%
								if (session.getAttribute("userName") == null) {
							%>
							<p class="login">未登录</p>
							<%
								} else {
							%>
							<p class="login">欢迎:${userName}</p>
							<%
								}
							%>
							<div>
								<ul style="width: 50%;">
									<li><a href="usercenter.jsp">个人资料</a></li>
									<li><a href="ordercenter.jsp">订单中心</a></li>
									<li><a href="login">切换账号</a></li>
								</ul>
							</div>
					</div>
<div class="fr form" >
<form action="search.do" method="post">	
	<input type="text"  name="search" id="sousuo"  value=""onclick = "checkUser();" placeholder="输入搜索">
	 <!-- <input type="button" value="搜索"> -->
	 </form>
</div>

						<div class="clearfix"></div>
					</div>
					<div class="clearfix"></div>
				</nav>
			</header>
		</div>
		

<!-- <div class="ui-widget">
<input type="text" name="bname">

</div> -->

<!-- 把智能匹配后的数据进行展示 -->
<!-- <script>
  function dname(){
    var search = $("#sousuo").val();
      $.ajax({
        url:"search.do",
        type:"post",
        cache: false,
        dataType: "json",
        data:{"search":search},
         success:function(data){
           alert("得到的数据"+data);
           for(var i=0; i<data.length();i++){
               alert(i.data);
           }
        
        },
        error: function(){
         alert("接受数据失败！！！");
        
        } 

      })  
        
  }
</script>
 -->

<!-- 智能匹配  -->
  <script>
  $( function() {
    $( "input[name=search]" ).autocomplete({
      source: "head.do",//会向服务器head。do.后台传来数据库中的值
      minLength: 1,
    });
  } );
  </script>


<!-- 智能匹配  -->
<!--  <script>
  $( function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  } );
  </script> -->






		
				<script type="text/javascript">
    $(document).ready(function(){    	
    	$('#cnzz_stat_icon_1265187549').appendTo('.footer_bottom_p')    	
    	var str=location.href;
    	var search_val = str.split("/");
    	var search_key = decodeURI(search_val[search_val.length-2]);
    	var search_val = decodeURI(search_val[search_val.length-1]);
    	if(search_key=='keyword'){
    		$("#search_info").val(search_val);
        }
        if(search_key=='choice'){
    	    $('.ipt').addClass('ipt_q');
            $(".condition").attr('jingxuan',1);

        }

        //其他导航条特效
        if(window.location.pathname=='/'||window.location.pathname==''){
            $('.remove_cur').siblings().removeClass('cur');
            $('.index_is_cur').addClass('cur');
        }
        if(window.location.pathname=='/Cms/Page/ArtworkList/' || window.location.pathname=='/artwork/'){
            $('.remove_cur').siblings().removeClass('cur');
            $('.art_is_cur').addClass('cur');
        }
        if(window.location.pathname=='/Cms/Page/ArtistList/' || window.location.pathname=='/artist/'){
            $('.remove_cur').siblings().removeClass('cur');
            $('.arter_is_cur').addClass('cur');
        }
        if(window.location.pathname=='/Cms/Lease/Index/' || window.location.pathname=='/lease/'){
            $('.remove_cur').siblings().removeClass('cur');
            $('.lease_is_cur').addClass('cur');
        }
        if(window.location.pathname=='/Cms/Zhuanti/Index/' || window.location.pathname=='/zhuanti/'){
            $('.remove_cur').siblings().removeClass('cur');
            $('.special_is_cur').addClass('cur');
        }
        if(window.location.pathname=='/Cms/News/XinxianShi/' || window.location.pathname=='/news/'){
            $('.remove_cur').siblings().removeClass('cur');
            $('.information_is_cur').addClass('cur');
        }

        //艺术家详情导航条特效
        var arrhost = window.location.host.split('.');
        if(arrhost['1']=="s"){
            $('.remove_cur').siblings().removeClass('cur');
            $('.arter_is_cur').addClass('cur');
        }
    });
	var anti_shake; // 防抖
	$('.header_atw').hover(function(){
		$('.nav_next').width($(window).width());
		clearTimeout(anti_shake);
		anti_shake = setTimeout(function(){
			$('.nav_next').stop().animate({
				height:"142px",
				paddingTop: "29px"
			},200);
			$('.nav_next ul li').css("display","block");
		}, 120);
	},function(){
		clearTimeout(anti_shake);
		$('.nav_next ul li').css("display","none")
		$('.nav_next').stop().animate({
			height:"0px",
			paddingTop: "0px"
		},200);
	})
	//个人中心下滑效果
	$('.header_box header .search .user').hover(function(){
		clearTimeout(anti_shake);

		anti_shake = setTimeout(function(){
			$('.header_box header .search .user div').animate({
				height:"120px"
			},200,function(){
				$('.header_box header .search .user div li').css("display","block")
			});
		},120);
	},function(){
		clearTimeout(anti_shake);
		$('.header_box header .search .user div').animate({
			height:"0px"
		},200,function(){
			$('.header_box header .search .user div li').css("display","none")
		});
	})
//滚动距离超过200px
    $(window).scroll(function(){
      if($(window).scrollTop() >= 88){
      	 $('body').css("padding-top","200px")
      	$('.header_box').css({
        	"position":"fixed",
        	"height":"88px",
        	"box-shadow":"0 2px 6px 0 rgba(0, 0, 0, 0.1)",
        	"z-index":50,
        	"top": 0
       });

        $("header").css({
        	"padding-top":"26.5px"
        });
         $(".nav_next").css({
        	"top":"88px"
        });
        $('nav>ul').css({
        	"width":"40%"
        });
         $('nav search user div ul').css({
        	"width":"100%"
        });
        $('.scr_hide').hide();
        $(".heard_log").hide();
        $(".heard_log2").css("display","block");
      }else{
      	$('body').css("padding-top","0px")
      	$('.header_box').css({
        	"position":"relative",
        	"height":"200px",
        	"box-shadow":"none"
       });
        $("header").css({
        	"padding-top":"30px"
        });
        $(".nav_next").css({
        	"top":"200px"
        });
        $('nav ul').css({
        	"width":"50%"
        })
        $('.scr_hide').show();
       $(".heard_log").show();  
       $(".heard_log2").hide();
      }
    });

$(function() {
	$("#search-form").click(function() {
		var search = "/Cms/Page/ArtworkList/keyword/";
		if($('#search_info').val()==''||$('#search_info').val()=='undefind'||$('#search_info').val()==null){
            $('#search_info').val('油画风景');
        }
		location.href = search + $('#search_info').val();
		return false;
	});
	
	//按下Enter键搜索
	$("#search_info").keydown(function (e) {//当按下按键时  
	    if (e.which == 13) {//.which属性判断按下的是哪个键，回车键的键位序号为13  
	        $('#search-form').trigger("click");//触发搜索按钮的点击事件  
	    }
	});
});
    function bfwResponse(resjson) {
        if(resjson['err']){
            $.Bfw.toastshow(resjson['data']);
        }else{
            if (resjson['data'].substr(0, 9) == "redirect:") {
                location.href = resjson['data'].substr(9);
            }else if(resjson['data'].substr(0, 12) =="msgredirect:"){
                var spos=resjson['data'].indexOf("---");
        if(spos>12){
                    $.Bfw.toastshow(resjson['data'].substr(12, spos-12));
                    var gotohref=resjson['data'].substr(spos+3);
                    console.log(gotohref);
            if(gotohref=="back"){
                        history.back();
                    }else{
                        location.href = gotohref;
                    }
                }
            }else if(resjson['data'].substr(0, 4) =="back"){
                history.back();
            }
            else {
                $.Bfw.toastshow(resjson['data']);
            }
        }
    }
</script>

		